home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
acciap1g
/
frmopen.frm
< prev
next >
Wrap
Text File
|
1999-08-01
|
12KB
|
359 lines
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
Begin VB.Form FrmOpen
BorderStyle = 3 'Fixed Dialog
Caption = "#1"
ClientHeight = 4200
ClientLeft = 45
ClientTop = 330
ClientWidth = 5445
Icon = "FrmOpen.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4200
ScaleWidth = 5445
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.PictureBox FrmRescent
BorderStyle = 0 'None
Height = 2895
Left = 360
ScaleHeight = 2895
ScaleWidth = 4005
TabIndex = 2
Top = 600
Width = 4005
Begin ComctlLib.ListView LstRecentFiles
Height = 1935
Left = 120
TabIndex = 5
Top = 120
Width = 3735
_ExtentX = 6588
_ExtentY = 3413
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
_Version = 327682
Icons = "ImageList"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 2
BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
Key = ""
Object.Tag = ""
Text = "#1"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
SubItemIndex = 1
Key = ""
Object.Tag = ""
Text = "#2"
Object.Width = 2540
EndProperty
End
Begin VB.CommandButton CmdCancel
Cancel = -1 'True
Caption = "CmdCancel"
Height = 350
Left = 120
TabIndex = 4
Top = 2520
Width = 1120
End
Begin VB.CommandButton CmdOpen
Caption = "CmdOpen"
Height = 350
Left = 120
TabIndex = 3
Top = 2160
Width = 1120
End
End
Begin VB.PictureBox FrmOpenWindow
BorderStyle = 0 'None
Height = 2655
Left = 240
ScaleHeight = 2655
ScaleWidth = 3885
TabIndex = 1
Top = 600
Width = 3885
End
Begin ComctlLib.TabStrip TabStrip
Height = 3855
Left = 120
TabIndex = 0
Top = 120
Width = 4575
_ExtentX = 8070
_ExtentY = 6800
_Version = 327682
BeginProperty Tabs {0713E432-850A-101B-AFC0-4210102A8DA7}
NumTabs = 3
BeginProperty Tab1 {0713F341-850A-101B-AFC0-4210102A8DA7}
Caption = "#1"
Key = ""
Object.Tag = ""
ImageVarType = 2
EndProperty
BeginProperty Tab2 {0713F341-850A-101B-AFC0-4210102A8DA7}
Caption = "#2"
Key = ""
Object.Tag = ""
ImageVarType = 2
EndProperty
BeginProperty Tab3 {0713F341-850A-101B-AFC0-4210102A8DA7}
Caption = "#3"
Key = ""
Object.Tag = ""
ImageVarType = 2
EndProperty
EndProperty
End
Begin VB.Timer TmrSetWindow
Interval = 25
Left = 4800
Top = 120
End
Begin ComctlLib.ImageList ImageList
Left = 4800
Top = 600
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 327682
BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
NumListImages = 3
BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "FrmOpen.frx":000C
Key = ""
EndProperty
BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "FrmOpen.frx":0326
Key = ""
EndProperty
BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "FrmOpen.frx":0640
Key = ""
EndProperty
EndProperty
End
End
Attribute VB_Name = "FrmOpen"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public AllowClick As Boolean
Private Sub CmdCancel_Click()
Unload Me
End Sub
Private Sub CmdOpen_Click()
On Error Resume Next
Dim Filename As String
Filename = Me.LstRecentFiles.SelectedItem.SubItems(1)
If Err Then
MsgBox "Please select a item first.", vbCritical
ElseIf Left(Filename, 2) = "::" Then
DialogRetData = Filename
Unload Me
ElseIf FileExist(Filename) = False Then
MsgBox Filename & Chr(10) & "File not found", vbExclamation
Else
MsgBox Filename
DialogRetData = Filename
Unload Me
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim i As Integer
If Shift = vbCtrlMask And KeyCode = vbKeyTab Then
i = Me.TabStrip.SelectedItem.Index
If i = Me.TabStrip.Tabs.Count Then
Set Me.TabStrip.SelectedItem = Me.TabStrip.Tabs(1)
Else
Set Me.TabStrip.SelectedItem = Me.TabStrip.Tabs(i + 1)
End If
End If
End Sub
Private Sub Form_Load()
'
'Get the command captions
'
Me.TabStrip.Tabs(1).Caption = GetCaption(Tab_New)
Me.TabStrip.Tabs(2).Caption = GetCaption(Tab_Open)
Me.TabStrip.Tabs(3).Caption = GetCaption(Tab_Recent)
Me.CmdCancel.Caption = GetCaption(Cmd_Cancel)
Me.CmdOpen.Caption = GetCaption(Cmd_Open)
Me.LstRecentFiles.ColumnHeaders(1).Text = GetCaption(LstItm_Name)
Me.LstRecentFiles.ColumnHeaders(2).Text = GetCaption(LstItm_File)
FrmPossDialog.Top = Me.Top + Me.FrmOpenWindow.Top + (-20 * GetTitleBarHeight) 'set the poss of the dialog this makes it less 'flashing'
FrmPossDialog.Left = Me.Left + Me.FrmOpenWindow.Left + 200
Me.TmrSetWindow.Enabled = True 'Enable the 'Open-Window Finder'
Me.Caption = Use_Caption
'
' Load the Openwindow, but clips to FrmPossDialog for possition. using the timer
' Uses the random caption.
'
Retdata = OpenDialog(FrmPossDialog.hwnd, TempCaption)
If Not Retdata = vbNullString Then DialogRetData = Retdata 'If the user choose to open a file set this to the return
Unload Me 'Done
End Sub
Private Sub Form_Unload(Cancel As Integer)
'Nothing here, the opendialog is a child, so closed with main window (if still open)
End Sub
Private Sub LstRecentFiles_DblClick()
If AllowClick = True Then 'If the user dblclicked an item it is set to true by LstRecentFiles_MouseDown
CmdOpen_Click
End If
End Sub
Private Sub LstRecentFiles_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
On Error Resume Next
If Not Me.LstRecentFiles.HitTest(x, y).Text = vbNullString Then 'Check if the user clicked an item
AllowClick = True 'Yes
End If
If Err Then AllowClick = False 'No
End Sub
Private